//
// C++ Interface: activity
//
// Description:
//
//
// Author: Willi Ballenthin <wilbal1087@gmail.com>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef ACTIVITY_H
#define ACTIVITY_H

#include <QObject>
#include <QtCore>
#include <QtSql>

/**
* A class representing an athletic activity, that took
* place over a period of time, on some day, etc.  This
* class should be subclassed for each backend database
* scheme, implementing insert, modify, query, etc.
    @author Willi Ballenthin <wilbal1087@gmail.com>
*/
class Activity
{

    public:
        Activity ();
        Activity ( const Activity& act);
        Activity& operator=(const Activity& act);

        ~Activity();

        // this is the official order of members
        // when relevant, ie indices
        QDate   getDate();
        QTime   getTime();
        QTime   getDuration();
        float   getDistance();
        int     getEffort();
        QString getType();
        QString getLocation();
        QString getRoute();
        QString getNotes();
        QString getSplits();
        int     getId();


        void setDate(QDate);
        void setTime(QTime);
        void setDuration(QTime);
        void setDistance(float);
        void setEffort(int);
        void setType(QString);
        void setLocation(QString);
        void setRoute(QString);
        void setNotes(QString);
        void setSplits(QString);
        void setId(int);

        void setDB(QSqlDatabase*);

        bool insert ( QSqlDatabase* db );
        bool insert();

        static int visibleFields;



//  date, timeOfAct, time, distance, effort, type, location, route, notes, splits
//  "date", "timeOfAct", "time", "distance", "effort", "type", "location", "route", "notes", "splits"
    protected:
        QDate   date;
        QTime   time;
        QTime   duration;
        float   distance;
        QString location;
        QString type;
        QString route;
        QString notes;
        QString splits;
        int     effort;
        int     id;
        QSqlDatabase* db;

};

#endif
